import request from '@/utils/request'

//AI对话
export function aiQa(data) {
	return request({
		url: '/student/ai/aiQa',
		method: 'post',
		data
	})
}


//本地接口	
export function apiChat(data, ctrl) {
	return fetch('http://192.168.1.223:10086/api/chat', {
		method: 'POST',
		body: JSON.stringify(data),
		signal: ctrl.signal, // AbortSignal
	})
}


//远程接口	
export function chatCompletions(data, ctrl) {
	return fetch('http://192.168.1.200:10088/v1/chat/completions', {
		method: 'POST',
		headers: { Authorization: 'Bearer sk-sdzfkjptb', 'Content-Type': 'application/json' },
		body: JSON.stringify(data),
		signal: ctrl.signal, // AbortSignal
	})
}
